package com.neusoft.tyut.npi.admin.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.neusoft.tyut.npi.admin.entity.Emp;
import com.neusoft.tyut.npi.admin.mapper.EmpMapper;
import com.neusoft.tyut.npi.admin.service.IEmpService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 服务实现类
 *
 * @author 段静迪,duanjingdi@163.com
 * @since 2024-09-24
 */
@Service
public class EmpServiceImpl extends ServiceImpl<EmpMapper, Emp> implements IEmpService {

    public IPage<Emp> selectPageVo1(IPage<Emp> page, Integer state) {
        LambdaQueryWrapper<Emp> lambdaQueryWrapper = new LambdaQueryWrapper<>();
        lambdaQueryWrapper.orderBy(true, false, Emp::getSal);
        page = new Page<>(2, 3);
        IPage<Emp> paged = baseMapper.selectPage(page, lambdaQueryWrapper);
        return paged;
    }

    // 或者返回 List
    public List<Emp> selectPageVo2(IPage<Emp> page, Integer state) {
        return null;
    }
}
